<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>后台管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="<?php echo IUrl::creatUrl("")."views/".$this->theme."/skin/".$this->skin."/css/admin.css";?>" />
<script charset="UTF-8" src="/runtime/systemjs/jquery-1.4.4.min.js"></script>
<script charset="UTF-8" src="/runtime/systemjs/artdialog/artDialog.min.js"></script>
<script charset="UTF-8" src="/runtime/systemjs/form.js"></script>
<link rel="stylesheet" type="text/css" href="/runtime/systemjs/autovalidate/style.css"/><script charset="UTF-8" src="/runtime/systemjs/autovalidate/validate.js"></script>
<script type='text/javascript' src="<?php echo IUrl::creatUrl("")."views/".$this->theme."/javascript/common.js";?>"></script>
<script type='text/javascript' src="<?php echo IUrl::creatUrl("")."views/".$this->theme."/javascript/admin.js";?>"></script>
<script type='text/javascript' src="<?php echo IUrl::creatUrl("")."views/".$this->theme."/javascript/menu.js";?>"></script>
</head>
<body>
<div class="container">
	<div id="header">
		<div id="menu">
			<ul name="menu">
			</ul>
		</div>
		<p><a href="<?php echo IUrl::creatUrl("/systemadmin/logout");?>">退出管理</a> <a href="<?php echo IUrl::creatUrl("/system/default");?>">后台首页</a> <a href="<?php echo IUrl::creatUrl("");?>" target='_blank'>商城首页</a> <span>您好 <label class='bold'><?php echo isset($this->admin['admin_name'])?$this->admin['admin_name']:"";?></label>，当前身份 <label class='bold'><?php echo isset($this->admin['admin_role_name'])?$this->admin['admin_role_name']:"";?></label></span></p>
	</div>
	<?php $admin_id = $this->admin['admin_id']?>
	<div id="info_bar"><label class="navindex"><a href="<?php echo IUrl::creatUrl("/system/navigation");?>">快速导航管理</a></label><span class="nav_sec">
	<?php $query = new IQuery("quick_naviga");$query->where = "adminid = $admin_id and is_del = 0";$items = $query->find(); foreach($items as $key => $item){?>
	<a href="<?php echo isset($item['url'])?$item['url']:"";?>" class="selected"><?php echo isset($item['naviga_name'])?$item['naviga_name']:"";?></a>
	<?php }?>
	</span></div>
	<div id="admin_left">
		<ul class="submenu">
		</ul>
		<div id="copyright">
			
		</div>
	</div>
	<?php $menu = new Menu();?>
	<script type='text/javascript'>
		var data = <?php echo $menu->submenu();?>;
		var current = '<?php echo $menu->current;?>';
		var url='<?php echo IUrl::creatUrl("/");?>';
		initMenu(data,current,url);
	</script>
	<div id="admin_right">
	<script charset="UTF-8" src="/runtime/systemjs/editor/kindeditor-min.js"></script>
<div class="headbar">
	<div class="position"><span>系统</span><span>></span><span>支付管理</span><span>></span><span>支付插件配置</span></div>
</div>
<div class="content_box">
	<div class="content form_content">
		<form action="<?php echo IUrl::creatUrl("/system/payment_update/");?>" method="post" enctype="multipart/form-data">
			<table class="form_table" cellpadding="0" cellspacing="0">
				<col width="150px" />
				<col />
				<tr>
					<th>支付方式名称：</th>
					<td><input class="normal" name="name" type="text" value="<?php echo isset($name)?$name:"";?>" pattern="required" alt="支付方式名称不能为空！" />
						<label>*</label>
					</td>
				</tr>
				<tr>
					<th>支持交易货币：</th>
					<td><?php echo isset($SupportCurrency)?$SupportCurrency:"";?></td>
				</tr>
				 <?php foreach($attr_list as $key => $item){?>
					<tr>
						<th><?php echo isset($item['label'])?$item['label']:"";?>：</th>
						<td>
							<?php if( $item['type']=='string'){?>
								<input class="normal" name="setting[<?php echo isset($key)?$key:"";?>]" type="text" value="<?php echo isset($config[$key])?$config[$key]:"";?>" pattern="required" alt="<?php echo isset($item['label'])?$item['label']:"";?>名称不能为空！" />
							<?php }elseif($item['type']=='radio'){?>
								<?php foreach($item['options'] as $value => $option){?>
									<label><input type="radio"  name="setting[<?php echo isset($key)?$key:"";?>]" value="<?php echo isset($value)?$value:"";?>" <?php if($config[$key]==$value){?> checked='checked' <?php }?> onclick="<?php echo isset($item['event'])?$item['event']:"";?>(this)" /><?php echo isset($option)?$option:"";?></label>
								<?php }?>
							<?php }elseif($item['type']=='select'){?>
								<select name="setting[<?php echo isset($key)?$key:"";?>]">
								<?php foreach($item['options'] as $value => $option){?>
									<option value="<?php echo isset($value)?$value:"";?>" <?php if($config[$key]==$value){?> 'selected' <?php }?>><?php echo isset($option)?$option:"";?></option>
								<?php }?>
								</select>
							<?php }elseif($item['type']=='file'){?>
								<input type="file" name="config[<?php echo isset($key)?$key:"";?>]" />
								<input type="hidden" name="setting[<?php echo isset($key)?$key:"";?>]" value="<?php echo isset($config[$key])?$config[$key]:"";?>" />
							<?php }?>
							<?php echo isset($item['eventscripts'])?$item['eventscripts']:"";?>
						</td>
					</tr>
					<?php if( isset($item['extendcontent'])){?>
						<?php foreach($item['extendcontent'] as $key => $eitem){?>
							<tr id="<?php echo isset($eitem['property']['extconId'])?$eitem['property']['extconId']:"";?>">
								<th></th>
								<td>
									<ul>
									<?php foreach($eitem['value'] as $key => $evitem){?>
									<li style="width:10em;float:left;">
										<input type="<?php echo isset($eitem['property']['type'])?$eitem['property']['type']:"";?>" name="setting[<?php echo isset($eitem['property']['name'])?$eitem['property']['name']:"";?>][]" value="<?php echo isset($evitem['value'])?$evitem['value']:"";?>" <?php echo isset($evitem['checked'])?$evitem['checked']:"";?> />
										<img src="<?php echo IUrl::creatUrl("")."plugins/payments/images/";?><?php echo isset($evitem['imgname'])?$evitem['imgname']:"";?>" />
									</li>
									<?php }?>
									</ul>
								</td>
							</tr>
						<?php }?>
					<?php }?>
				 <?php }?>
				<tr>
					<th>手续费设置：</th>
					<td>
						<label><input name="poundage_type" type="radio" value="1" <?php if($poundage_type==1){?> checked="checked" <?php }?>  onclick="radioselect(this)" />按百分比收费</label>
						<label><input name="poundage_type" type="radio" value="2" <?php if($poundage_type==2){?> checked="checked" <?php }?> onclick="radioselect(this)" />按固定额度收费</label>
					</td>
				</tr>
				<tr id="poundage_rate"  <?php if($poundage_type==2){?>  style="display:none" <?php }?>>
					<th></th>
					<td>
						费率：<input class="tiny" name="poundage_rate" type="text" value="<?php echo isset($poundage_rate)?$poundage_rate:"";?>"  pattern="required" alt="费率不能为空！" />% &nbsp;&nbsp; 说明：顾客将支付订单总金额乘以此费率作为手续费；
					</td>
				</tr>
				<tr id="poundage_fix" <?php if($poundage_type==1){?>  style="display:none" <?php }?>>
					<th></th>
					<td>
						金额：<input class="tiny" name="poundage_fix" type="text" value="<?php echo isset($poundage_fix)?$poundage_fix:"";?>" pattern="required" alt="金额不能为空！" />元 &nbsp;&nbsp; 说明：顾客每笔订单需要支付的手续费；
					</td>
				</tr>
				<tr>
					<th>类型：</th>
					<td>
						<select name="type" pattern='required'>
							<option value=''>请选择支付类型</option>
							<?php if($file_path != 'offline'){?>
							<option <?php if($type=='1'){?>selected=selected<?php }?> value="1">线上支付</option>
							<?php }?>
							<option <?php if($type=='2'){?>selected=selected<?php }?> value="2">线下支付</option>
						</select>
					</td>
				</tr>
				<tr>
					<th>排序：</th><td><input class="tiny" name="order" type="text" value="<?php echo isset($order)?$order:"";?>" pattern="required" alt="排序不能为空！" /></td>
				</tr>
				<tr>
					<th valign="top">描述：</th>
					<td><textarea name="description" rows="10" cols="25"><?php echo isset($description)?$description:"";?></textarea></td>
				</tr>
				<tr>
					<th>支付说明：</th>
					<td><textarea id="note" name="note" style="width:530px;height:250px;visibility:hidden;"><?php echo isset($note)?$note:"";?></textarea>
						<label>此信息会展示在用户的支付页面，尤其是线下支付时可以填写收款账号等信息</label>
					</td>
				</tr>
				<tr>
					<th></th>
					<td>
						<input type="hidden" name="pay_type" value="<?php echo isset($file_path)?$file_path:"";?>" />
						<input type="hidden" name="id" value="<?php echo isset($plugin_id)?$plugin_id:"";?>" />
						<input type="hidden" name="pay_id" value="<?php echo isset($pay_id)?$pay_id:"";?>" />
						<button class="submit" type='submit'><span>确 定</span></button>
					</td>
				</tr>
			</table>
		</form>
	</div>
</div>
<script language="javascript">
	KE.show({
		id : 'note',
		imageUploadJson:'<?php echo IUrl::creatUrl("/block/upload_img_from_editor");?>'
	});

	function radioselect(obj)
	{
		if(obj.value==1)
		{
			$('#poundage_rate').show();
			$('#poundage_fix').hide();
		}
		else
		{
			$('#poundage_fix').show();
			$('#poundage_rate').hide();
		}
	}
</script>

	</div>
	<div id="separator"></div>
</div>
<script type='text/javascript'>
	//隔行换色
	$(".list_table tr::nth-child(even)").addClass('even');
	$(".list_table tr").hover(
		function () {
			$(this).addClass("sel");
		},
		function () {
			$(this).removeClass("sel");
		}
	);
	$(function(){
		 $('#headth th').each(function(i){
			var width = $('#headth th:eq('+i+')').width();
			$('#conth tr:eq(0) td:eq('+i+')').width(width-2);
		});
	});
</script>
</body>
</html>
